
<template>
  <div class="move">
      
     <van-search v-model="value" shape="round" background="" show-action placeholder="请按照书名进行搜索" @search="onSearch">
    <template #action>
    <div @click="onSearch">
      <div v-if="value!=0">
      <van-button plain hairline type="info">搜索</van-button>
      </div>
      <div v-else>
         <van-button disabled type="info">搜索</van-button>
      </div>
      </div>
    </template>
    </van-search>
    
<van-swipe :autoplay="2000">
  <van-swipe-item  v-for="(image , index) in images" :key="index">
    <img v-lazy="image" />
  </van-swipe-item>
</van-swipe>
    
  </div>
</template>

<script>
import { Toast } from 'vant';
 export default {
        data() {
            return { 
                images: [
            require('../image/111.jpg'),
            require('../image/2.jpg'),
            require('../image/3.jpg'),
            require('../image/4.jpg'),
            require('../image/5.jpg'),
      ],     
             value:"",   
            }
        },
        methods:{
          onSearch(){
            if(this.value!=0)
            {
              Toast('正在搜索请稍等~');
              this.$router.push(`/search/${this.value}`);
            }
            else {
              Toast('你不输入我查啥？？');
            }
          }
        }
    };

</script>
<style>
  .move img{
    width: 100%;
    height: 200px;
    
  }
  </style>